<template>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">合作单位</BaseHead>
    <el-table :data="unitList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="unitName" label="单位名称" />
      <el-table-column prop="chargerName" label="负责人" />
      <el-table-column prop="contractFee" label="合同金额（万元）" />
      <el-table-column label="单位类型">
        <template #default="{ row }">
          <CommonLabel :value="row.unitType" :dataList="unitTypeList" />
        </template>
      </el-table-column>
      <el-table-column prop="bankName" label="银行名称" />
      <el-table-column prop="bankNum" label="银行账号" />
    </el-table>
  </div>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">经费外拨</BaseHead>
    <el-table :data="outboundMainVoList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="projectName" label="项目名称" />
      <el-table-column prop="chargerName" label="负责人" />
      <el-table-column prop="outboundFee" label="申请外拨金额（万元）" />
      <el-table-column prop="outbounddate" label="申请外拨日期" />
      <el-table-column prop="unitName" label="所属单位" />
      <el-table-column label="审核状态">
        <template #default="{ row }">
          <CommonLabel
            :dataList="checkStatusList"
            valueKey="dictValue"
            labelKey="dictLabel"
            :value="row.checkstatus"
          />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import { unitDetail } from "@/api/project/zx/lxxm";
import CommonLabel from "@/views/project/components/CommonLabel.vue";
const operateId = inject("id");
const unitTypeList = inject("unitTypeList");
const checkStatusList = inject("checkStatusList");
const unitList = ref([]);
const outboundMainVoList = ref([]);
//获取单位信息详情
const getUnitDetail = async () => {
  try {
    const res = await unitDetail(operateId.value);
    unitList.value = res.data.bizProjectCooperationUnitList;
    outboundMainVoList.value = res.data.outboundMainVoList;
  } catch (error) {
    console.log(error);
  }
};
onMounted(() => {
  getUnitDetail();
});
</script>

<style scoped lang="scss"></style>
